"use strict";
cc._RF.push(module, 'be306LDYUZH+Ka1YrQBlnrx', 'AniTool');
// scripts/AniTool.js

"use strict";

var e = require;
var t = module;
var n = exports;
Object.defineProperty(n, "__esModule", {
  value: !0
});
n.AniType = void 0;
var o,
    i = cc._decorator,
    a = i.ccclass,
    r = i.property;

(function (e) {
  e[e["无动画"] = 0] = "无动画";
  e[e["扭动"] = 1] = "扭动";
  e[e["缩放"] = 2] = "缩放";
  e[e["红点"] = 3] = "红点";
})(o = n.AniType || (n.AniType = {}));

var s = function (e) {
  __extends(t, e);

  function t() {
    var t = null !== e && e.apply(this, arguments) || this;
    t.aniType = o.无动画;
    t.initScale = 1;
    return t;
  }

  t.prototype.onLoad = function () {
    this.initScale = this.node.scale;
  };

  t.prototype.start = function () {
    this.playAni();
  };

  t.prototype.playAni = function () {
    this.node.stopAllActions();

    if (this.aniType == o.扭动) {
      var e = cc.repeatForever(cc.sequence(cc.rotateTo(.15, -10).easing(cc.easeSineOut()), cc.rotateTo(.15, 10).easing(cc.easeSineOut()), cc.rotateTo(.15, -10).easing(cc.easeBackOut()), cc.rotateTo(.15, 10).easing(cc.easeSineOut()), cc.rotateTo(.15, -10).easing(cc.easeSineOut()), cc.rotateTo(.15, 0).easing(cc.easeSineOut()), cc.delayTime(2)));
      this.node.runAction(e);
    } else if (this.aniType == o.缩放) {
      e = cc.repeatForever(cc.sequence(cc.scaleTo(.15, 1.1 * this.initScale).easing(cc.easeSineOut()), cc.scaleTo(.15, this.initScale).easing(cc.easeSineOut()), cc.scaleTo(.15, 1.1 * this.initScale).easing(cc.easeSineOut()), cc.scaleTo(.15, this.initScale).easing(cc.easeSineOut()), cc.delayTime(2)));
      this.node.runAction(e);
    }
  };

  __decorate([r({
    type: cc.Enum(o),
    displayName: "动画类型"
  })], t.prototype, "aniType", void 0);

  return __decorate([a], t);
}(cc.Component);

n["default"] = s;

cc._RF.pop();